/**
 * Created with IntelliJ IDEA.
 * Description:
 * https://gitee.com/li--jiaqiang/java-test.git
 * git pull
 * git pull origin master
 * git pull origin master --allow-unrelated-histories
 * User: 86187
 * Date: 2022-04-23
 * Time: 20:13
 */

//Scanner scan = new Scanner(System.in);


public class TestDemo3 {
    /**
     * 求水仙花数
     */
    public static void narc() {
        int k = 0;
        int sum = 0;
        for (int i = 100; i <=999 ; i++) {
            k = i;
            sum = 0;
            while(k != 0) {
                sum += (int)Math.pow((k % 10),3);
                k /= 10;
            }
            if(sum == i) {
                System.out.print(i+" ");
            }
        }
    }

    public static void main(String[] args) {
        narc();
    }

}
